package com.example.lxj.qa.service.impl;

import java.util.List;

import cn.hutool.core.date.DateUtil;
import com.example.lxj.qa.entity.TbAppraisalReports;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.example.lxj.qa.mapper.TbAppraisalReportsMapper;
import com.example.lxj.qa.service.ITbAppraisalReportsService;

/**
 * 鉴定报告Service业务层处理
 * 
 * @author lxj
 * @date 2024-10-15
 */
@Service
public class TbAppraisalReportsServiceImpl implements ITbAppraisalReportsService 
{
    @Autowired
    private TbAppraisalReportsMapper tbAppraisalReportsMapper;

    /**
     * 查询鉴定报告
     * 
     * @param id 鉴定报告主键
     * @return 鉴定报告
     */
    @Override
    public TbAppraisalReports selectTbAppraisalReportsById(Long id)
    {
        return tbAppraisalReportsMapper.selectTbAppraisalReportsById(id);
    }

    /**
     * 查询鉴定报告列表
     * 
     * @param tbAppraisalReports 鉴定报告
     * @return 鉴定报告
     */
    @Override
    public List<TbAppraisalReports> selectTbAppraisalReportsList(TbAppraisalReports tbAppraisalReports)
    {
        return tbAppraisalReportsMapper.selectTbAppraisalReportsList(tbAppraisalReports);
    }

    /**
     * 新增鉴定报告
     * 
     * @param tbAppraisalReports 鉴定报告
     * @return 结果
     */
    @Override
    public int insertTbAppraisalReports(TbAppraisalReports tbAppraisalReports)
    {
        tbAppraisalReports.setCreateTime(DateUtil.date());
        return tbAppraisalReportsMapper.insertTbAppraisalReports(tbAppraisalReports);
    }

    /**
     * 修改鉴定报告
     * 
     * @param tbAppraisalReports 鉴定报告
     * @return 结果
     */
    @Override
    public int updateTbAppraisalReports(TbAppraisalReports tbAppraisalReports)
    {
        tbAppraisalReports.setUpdateTime(DateUtil.date());
        return tbAppraisalReportsMapper.updateTbAppraisalReports(tbAppraisalReports);
    }

    /**
     * 批量删除鉴定报告
     * 
     * @param ids 需要删除的鉴定报告主键
     * @return 结果
     */
    @Override
    public int deleteTbAppraisalReportsByIds(Long[] ids)
    {
        return tbAppraisalReportsMapper.deleteTbAppraisalReportsByIds(ids);
    }

    /**
     * 删除鉴定报告信息
     * 
     * @param id 鉴定报告主键
     * @return 结果
     */
    @Override
    public int deleteTbAppraisalReportsById(Long id)
    {
        return tbAppraisalReportsMapper.deleteTbAppraisalReportsById(id);
    }
}
